package com.dems.web;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.dems.dao.MpDao;
import com.dems.dao.StudentDao;
import com.dems.domain.Mp;
import com.dems.domain.Student;


@WebServlet("/UpdateMpServlet")
public class UpdateMpServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private MpDao mpDao = new MpDao();
    /**
     * @see HttpServlet#HttpServlet()
     */
    public UpdateMpServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		//获取参数
		String mpNum = request.getParameter("mpNum");
		String mpName = request.getParameter("mpName");
		String mpPassword = request.getParameter("mpPassword");
		String mpPhone = request.getParameter("mpPhone");
		Mp mp = new Mp();
		mp.setMpNum(mpNum);
		mp.setMpName(mpName);
		mp.setMpPassword(mpPassword);
		mp.setMpPhone(mpPhone);
		mpDao.update(mp);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
